package com.zhoug.commonlib2;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.widget.ImageView;

import com.zhoug.common2.utils.StatusBarUtils;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @Author: zhoug
 * @Date: 2024-11-16
 * @Description:
 */
public class LaunchActivity extends MyBaseActivity {
    private ImageView mImageView;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_launch;
    }

    @Override
    protected void findViews() {

        mImageView = findViewById(R.id.imageView);
    }

    @Override
    protected void onCreate1(Bundle savedInstanceState) {
        //状态栏透明,且布局占用状态栏
        StatusBarUtils.transparentStatusBar(this);
        //不给状态栏预留位置
        StatusBarUtils.setFitsSystemWindows(this, false);

        Intent intent1 = getIntent();
        if(null !=intent1){
            Intent targetIntent=null;
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                targetIntent=intent1.getParcelableExtra(Params.TARGET_INTENT,Intent.class);
            }else{
                targetIntent=intent1.getParcelableExtra(Params.TARGET_INTENT);
            }
            MainActivity.targetIntent=targetIntent;
        }

        mImageView.postDelayed(() -> {
            Intent intent = new Intent(getActivity(), MainActivity.class);
            startActivity(intent);
            finish();
        }, 1000);
    }


}
